// craco自定义配置文件
const CracoLessPlugin = require('craco-less');
const CracoAlias = require('craco-alias')
var theme = require('./theme')
module.exports = {
  plugins: [
    {  //less解析、自定义主题配置
      plugin: CracoLessPlugin,
      options: {
        lessLoaderOptions: {
          lessOptions: {
            modifyVars: theme,  //主题配置
            javascriptEnabled: true,
          },
        },
      },
    },
    { //路径别名配置
      plugin: CracoAlias,
      options: {
        source: "options",
        baseUrl: "./",
        aliases: {
          "@": "./src",
          "@api": "./src/api"
        }
      }
    }
  ],
  devServer:{  //本地代理
    proxy:{
      '/hehe':{
        target:'https://shopapi.smartisan.com',
        pathRewrite:{
          '^/hehe':''
        },
        changeOrigin: true,
      }
    }
  }
}